package com.atguigu.gulimall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: MyRedissonConfig
 * Package： com.atguigu.gulimall.product.config
 * Description:
 *
 * @Author: Sweng
 * @Create: 2025/4/13 - 14:18
 * VERSION: version1.0
 **/
@Configuration
public class MyRedissonConfig {

    @Bean(destroyMethod = "shutdown")
    RedissonClient redisson(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.126.128:6379");

        RedissonClient redissonClient = Redisson.create(config);

        return redissonClient;
    }


}
